package br.com.serjaum.modelo;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;


@Embeddable
	public class MatriculaPK implements Serializable { 
	    //default serial version id, required for serializable classes. 
	    private static final long serialVersionUID = 1L; 
	    
	    @Column(name = "dni") 
	    private String dniMatricula; 
	   
	    
	    @Column(name = "cod_curso") 
	    private String codigoCursoMatricula;
		
	    public MatriculaPK(String dni, String codigoCurso) {
			super();
			this.dniMatricula = dni;
			this.codigoCursoMatricula = codigoCurso;
		}
		public MatriculaPK() {
			super();
		}
		public String getDni() {
			return dniMatricula;
		}
		public void setDni(String dni) {
			this.dniMatricula = dni;
		}
		public String getCodigoCurso() {
			return codigoCursoMatricula;
		}
		public void setCodigoCurso(String codigoCurso) {
			this.codigoCursoMatricula = codigoCurso;
		} 
	    
		 public boolean equals(Object other) {  
		        if (this == other) {  
		            return true;  
		        }  
		          
		        if (other instanceof MatriculaPK) {  
		        	MatriculaPK that = (MatriculaPK) other;  
		            return (this.getDni().equals(that.getDni()) &&  
		                    this.getCodigoCurso().equals(that.getCodigoCurso()));  
		        }  
		        return false;  
		 }
	    
	} 	